﻿<phone:PhoneApplicationPage
    x:Class="Animation.WP8.ShowcasePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone"
    xmlns:wp8="clr-namespace:Animation.WP8"
    xmlns:bam="clr-namespace:Brain.Animate;assembly=AnimationManager.WP8"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">



    <Grid x:Name="LayoutRoot">

        <bam:AnimationTrigger.Open>
            <bam:FadeInDownAnimation/>
        </bam:AnimationTrigger.Open>
        <bam:AnimationTrigger.Close>
            <bam:BounceOutAnimation Duration="0.6"/>
        </bam:AnimationTrigger.Close>

<!--
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="{StaticResource LightGreyColor}" Offset="0"/>
                <GradientStop Color="{StaticResource YellowColor}" Offset="0.346"/>
                <GradientStop Color="{StaticResource LightGreyColor}" Offset="1"/>
                <GradientStop Color="{StaticResource YellowColor}" Offset="0.642"/>
            </LinearGradientBrush>
        </Grid.Background>
-->

        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.6,0">
                <GradientStop Color="#FF5FF8FF" Offset="0"/>
                <GradientStop Color="#FF12D7FF" Offset="0.322"/>
                <GradientStop Color="{StaticResource YellowColor}" Offset="0.475"/>
                <GradientStop Color="{StaticResource LightGreyColor}" Offset="1"/>
                <GradientStop Color="{StaticResource YellowColor}" Offset="0.642"/>
            </LinearGradientBrush>
        </Grid.Background>

        <Grid RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
                <CompositeTransform SkewY="5"/>
            </Grid.RenderTransform>
            <bam:PanControl AutoPanRate="200" Opacity="0.8" VerticalAlignment="Top" >
                <bam:AnimationTrigger.Open>
                    <bam:BounceInAnimation/>
                </bam:AnimationTrigger.Open>

                <bam:PanControl.OtherContent>
                    <Image Source="/Images/Clouds.png" Width="800" Height="400" VerticalAlignment="Top" CacheMode="BitmapCache" />
                </bam:PanControl.OtherContent>
                <bam:PanControl.Content>
                    <Image Source="/Images/Clouds.png" Width="800" Height="400" VerticalAlignment="Top" CacheMode="BitmapCache" />
                </bam:PanControl.Content>
            </bam:PanControl>

            <bam:PanControl AutoPanRate="120" Opacity="0.8" Margin="0,50,0,0" Offset="300" VerticalAlignment="Top">
                <bam:AnimationTrigger.Open>
                    <bam:BounceInAnimation Delay="0.3"/>
                </bam:AnimationTrigger.Open>

                <bam:PanControl.OtherContent>
                    <Image Source="/Images/Clouds.png" Width="1000" VerticalAlignment="Top" CacheMode="BitmapCache" />
                </bam:PanControl.OtherContent>
                <bam:PanControl.Content>
                    <Image Source="/Images/Clouds.png" Width="400" VerticalAlignment="Top" CacheMode="BitmapCache" />
                </bam:PanControl.Content>
            </bam:PanControl>

            <bam:PanControl AutoPanRate="60" VerticalAlignment="Top" Margin="0,-55,0,0">
                <bam:AnimationTrigger.Open>
                    <bam:BounceInAnimation Delay="0.6"/>
                </bam:AnimationTrigger.Open>

                <bam:PanControl.OtherContent>
                    <Image Source="/Images/Bushes.png" Width="800" CacheMode="BitmapCache" />
                </bam:PanControl.OtherContent>
                <bam:PanControl.Content>
                    <Image Source="/Images/Bushes.png" Width="800" CacheMode="BitmapCache" />
                </bam:PanControl.Content>
            </bam:PanControl>
        </Grid>


        <Grid 
            Margin="0,0,0,50"
            HorizontalAlignment="Center" 
            VerticalAlignment="Center"  
            Tap="Person_OnTap"
            >
            <bam:DropShaddow x:Name="PersonWIthShaddow"
                Style="{StaticResource CircleDropShaddowStyle}" Width="100" Height="150" OffsetY="2">

                <bam:AnimationTrigger.Open>
                    <bam:BounceInAnimation Delay="0.9"/>
                </bam:AnimationTrigger.Open>
                <bam:AnimationTrigger.Close>
                    <bam:BounceOutAnimation Duration="1.5"/>
                </bam:AnimationTrigger.Close>

                <bam:AnimatedImage x:Name="Person" 
        			HorizontalAlignment="Left"
        			Width="100" Height="150" 
        			SpriteWidth="100" SpriteHeight="150" 
        			SpriteSheetSource="/Images/HeadSpriteSheet.png" 
        			FrameTimeSpan="00:00:00.2" Background="White" RenderTransformOrigin="0.5,0.5" IsAnimating="True"
                                     >

                    <bam:AnimatedImage.SpriteCoordinates>
                        <bam:SpriteCoordinate Name="Head1" X="0" Y="0" />
                        <bam:SpriteCoordinate Name="Head2" X="-100" Y="0" />
                        <bam:SpriteCoordinate Name="Head3" X="-200" Y="0" />
                        <bam:SpriteCoordinate Name="Head4" X="0" Y="-150" />
                        <bam:SpriteCoordinate Name="Head5" X="-100" Y="-150" />
                        <bam:SpriteCoordinate Name="Head6" X="-200" Y="-150" />
                        <bam:SpriteCoordinate Name="Head7" X="-300" Y="0" />
                        <bam:SpriteCoordinate Name="Head8" X="-300" Y="-150" />
                    </bam:AnimatedImage.SpriteCoordinates>
                </bam:AnimatedImage>
            </bam:DropShaddow>

        </Grid>

        <!--
        <bam:DropShaddow 
            Style="{StaticResource CircleDropShaddowStyle}" 
            Width="150" Height="150" OffsetY="2"
            HorizontalAlignment="Left" Margin="0,50,0,0" >
            <bam:AnimatedImage x:Name="AnimatedImage" 
                    Width="100" Height="150" 
                    SpriteWidth="82" SpriteHeight="150" 
                    SpriteSheetSource="/Images/WalkingSpriteSheet.png" 
                    SpriteCountX="8" SpriteIndex="0" IsAnimating="True"
                    FrameTimeSpan="00:00:00.2"
                />
        </bam:DropShaddow>
        -->

        <Button x:Name="target" Content="I am a Button" 
                VerticalAlignment="Top" HorizontalAlignment="Center" 
                Margin="50" FontSize="36" 
                Background="{StaticResource LightGreyBrush}" Foreground="{StaticResource DarkGreyBrush}">
            <bam:AnimationTrigger.Open>
                <bam:BounceInAnimation Delay="1.9"/>
            </bam:AnimationTrigger.Open>
            <bam:AnimationTrigger.Close>
                <bam:FadeOutAnimation/>
            </bam:AnimationTrigger.Close>
        </Button>

        <phone:Pivot VerticalAlignment="Bottom" Background="{x:Null}">
            <phone:PivotItem Header="Attention">
                <ListBox ItemsPanel="{StaticResource WrapPanel}" 
                         ScrollViewer.VerticalScrollBarVisibility="Disabled">
                    <Button Content="Flash" Click="Button_Click" Tag="Flash" />
                    <Button Content="Bounce" Click="Button2_Click" Tag="Bounce" />
                    <Button Content="Shake" Click="Button_Click" Tag="Shake" />
                    <Button Content="Tada" Click="Button_Click" Tag="Tada" />
                    <Button Content="Swing" Click="Button_Click" Tag="Swing" />
                    <Button Content="Wobble" Click="Button_Click" Tag="Wobble" />
                    <Button Content="Pulse" Click="Button_Click" Tag="Pulse" />
                    <Button Content="Jump" Click="Button2_Click" Tag="Jump" />
                </ListBox>
            </phone:PivotItem>

            <phone:PivotItem Header="Flippers">
                <ListBox ItemsPanel="{StaticResource WrapPanel}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                    <Button Content="Flip" Click="Button_Click" Tag="Flip" />
                    <Button Content="Flip Out X" Click="Button_Click" Tag="FlipOutX" />
                    <Button Content="Flip In X" Click="Button_Click" Tag="FlipInX" />
                    <Button Content="Flip Out Y" Click="Button_Click" Tag="FlipOutY" />
                    <Button Content="Flip In Y" Click="Button_Click" Tag="FlipInY" />

                    <Button Content="All" Click="AllFlippers_Click" Foreground="Tomato" />
                </ListBox>
            </phone:PivotItem>

            <phone:PivotItem Header="Fading">
                <StackPanel>
                    <ListBox ItemsPanel="{StaticResource WrapPanel}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <Button Content="In" Click="Button_Click" Tag="FadeIn" />
                        <Button Content="Out" Click="Button_Click" Tag="FadeOut" />
                        <Button Content="Out Up" Click="Button_Click" Tag="FadeOutUp" />
                        <Button Content="Out Down" Click="Button_Click" Tag="FadeOutDown" />
                        <Button Content="Out Left" Click="Button_Click" Tag="FadeOutLeft" />
                        <Button Content="Out Right" Click="Button_Click" Tag="FadeOutRight" />
                        <Button Content="In Up" Click="Button_Click" Tag="FadeInUp" />
                        <Button Content="In Down" Click="Button_Click" Tag="FadeInDown" />
                        <Button Content="In Left" Click="Button_Click" Tag="FadeInLeft" />
                        <Button Content="In Right" Click="Button_Click" Tag="FadeInRight" />
                    </ListBox>
                </StackPanel>
            </phone:PivotItem>

            <phone:PivotItem Header="Scaling">
                <StackPanel>
                    <ListBox ItemsPanel="{StaticResource WrapPanel}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <Button Content="In" Click="Button_Click" Tag="ScaleIn" />
                        <Button Content="Out" Click="Button_Click" Tag="ScaleOut" />
                    </ListBox>
                </StackPanel>
            </phone:PivotItem>

            <phone:PivotItem Header="Bouncing">
                <StackPanel>
                    <ListBox ItemsPanel="{StaticResource WrapPanel}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <Button Content="In" Click="Button_Click" Tag="BounceIn" />
                        <Button Content="Out" Click="Button_Click" Tag="BounceOut" />
                        <Button Content="Out Up" Click="Button_Click" Tag="BounceOutUp" />
                        <Button Content="Out Down" Click="Button_Click" Tag="BounceOutDown" />
                        <Button Content="Out Left" Click="Button_Click" Tag="BounceOutLeft" />
                        <Button Content="Out Right" Click="Button_Click" Tag="BounceOutRight" />
                        <Button Content="In Up" Click="Button_Click" Tag="BounceInUp" />
                        <Button Content="In Down" Click="Button_Click" Tag="BounceInDown" />
                        <Button Content="In Left" Click="Button_Click" Tag="BounceInLeft" />
                        <Button Content="In Right" Click="Button_Click" Tag="BounceInRight" />

                        <Button Content="X" Click="AllBounce_CLick" Foreground="Tomato" />
                    </ListBox>
                </StackPanel>
            </phone:PivotItem>

            <phone:PivotItem Header="Special">
                <ListBox ItemsPanel="{StaticResource WrapPanel}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                    <Button Content="Hinge" Click="Button_Click" Tag="Hinge" />
                    <Button Content="In Right" Click="Button_Click" Tag="LightSpeedInRight" />
                    <Button Content="Out Right" Click="Button_Click" Tag="LightSpeedOutRight" />
                    <Button Content="In Left" Click="Button_Click" Tag="LightSpeedInLeft" />
                    <Button Content="Out Left" Click="Button_Click" Tag="LightSpeedOutLeft" />
                    <Button Content="Reset" Click="Button_Click" Tag="Reset" />
                    <Button Content="Walk" Click="WalkButton_Click" />
                </ListBox>
            </phone:PivotItem>
        </phone:Pivot>

    </Grid>

</phone:PhoneApplicationPage>